<script type="text/javascript" src="/themes/plugins/jquery/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="/themes/plugins/bootstrap/js/bootstrap.js"></script>


<script>
    var _timer;
    var cur = '${cur!''}';
    hideMenu();
    $(".cat-list li").hover(function () {
        clearTimeout(_timer);
        var _this = $(this);
        $(".cat-layer").show();
        $(".cat-layer .item").hide();
        $(".cat-layer .item:eq(" + _this.index() + ")").show();
    }, function () {
        var _this = $(this);
        _timer =  setTimeout(function () {
            $(".cat-layer").hide();
            $(".cat-layer .item:eq(" + _this.index() + ")").hide();
            hideMenu();
        }, 100);
    });
    $("#cat-menu").hover(function () {
        $(".cat-list").show();
    }, function () {
        hideMenu();
    });
    $(".cat-layer .item").hover(function (){
        clearTimeout(_timer);
    },function(){
        _timer =  setTimeout(function () {
            $(".cat-layer").hide();
            $(this).hide();
            hideMenu();
        }, 100);
    });

    function hideMenu(){
        if(!cur || 'index' != cur){
            _timer =  setTimeout(function () {
                $(".cat-list").hide();
            }, 100);
        }
    }

    $.fn.onlyNum = function () {
        $(this).keypress(function (event) {
            var eventObj = event || e;
            var keyCode = eventObj.keyCode || eventObj.which;
            if ((keyCode >= 48 && keyCode <= 57) || keyCode == 8)//8是删除
                return true;
            else
                return false;
        }).focus(function () {
            //禁用输入法
            this.style.imeMode = 'disabled';
        }).bind("paste", function () {
            //获取剪切板的内容
            var clipboard = window.clipboardData.getData("Text");
            if (/^\d+$/.test(clipboard))
                return true;
            else
                return false;
        });
    };

    function pwd_submit() {
        var password = $('input[name="password"]').val();
        var pwd = $('input[name="pwd"]').val();
        var pwd2 = $('input[name="pwd2"]').val();
        if(password.length == 0){
            alert("请输入原密码");
            return;
        }
        if(pwd.length == 0){
            alert("请输入新密码");
            return;
        }
        if(pwd2.length == 0){
            alert("请输入确认密码");
            return;
        }
        if(pwd != pwd2){
            alert("两次密码不一样");
            return;
        }
        $.getJSON("/member/modifyPwd",{password:password,pwd:pwd,pwd2:pwd2},function(result){
            if(result.code == 200){
                alert("修改成功");
                location.href = "/join"
            }else{
                alert(result.message);
            }
        })
    }

</script>

<script>
    function fankui(){
        var content = $("#fdContent").val();
        $.getJSON("/feedback/save",{content:content},function(result){
            if(result.code == 200){
                alert("我们已经收到您的反馈信息");
                location.reload(true);
            }else{
                alert(result.message);
            }
        })
    }
</script>